/**
 * 
 */
package de.tsvberssel.domain;

import java.util.LinkedList;
import java.util.List;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author starbuck
 *
 */
@XmlRootElement(name="question")
public class Question {
	
	private int level = 1;

	private String text = null;
	
	private List<Answer> answers = null;
	
	private boolean used = false;
	
	/**
	 * @return the used
	 */
	@XmlAttribute
	public boolean isUsed() {
		return used;
	}

	/**
	 * @param used the used to set
	 */
	public void setUsed(boolean used) {
		this.used = used;
	}

	/**
	 * @return the answers
	 */
	@XmlElementRef
	public List<Answer> getAnswers() {
		if (this.answers == null) {
			this.answers = new LinkedList<Answer>();
			
		}
		return this.answers;
	}

	/**
	 * @param answers the answers to set
	 */
	public void setAnswers(List<Answer> answers) {
		this.answers = answers;
	}

	/**
	 * @return the text
	 */
	@XmlAttribute(required=true)
	public String getText() {
		return text;
	}

	/**
	 * @param text the text to set
	 */
	public void setText(String text) {
		this.text = text;
	}

	/**
	 * @return the level
	 */
	@XmlAttribute(required=true)
	public int getLevel() {
		return level;
	}

	/**
	 * @param level the level to set
	 */
	public void setLevel(int level) {
		this.level = level;
	}
	
	
	
}
